//
//  ViewController.m
//  迷笛
//
//  Created by . on 2018/9/5.
//  Copyright © 2018年 🍃🌺🌺🍃. All rights reserved.
//

#import "ViewController.h"
#import "MIDIHomepageController.h"
#import "MIDIMusicCircleController.h"
#import "MIDIMyController.h"
#import "MIDIlandingController.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(modalPageLogin) name:@"notification_modal_login" object:nil];

    
    //   黑色字变为白色
    self.navigationController.navigationBar.barStyle = UIBarStyleBlack;

    //    首页
    MIDIHomepageController * homepage = [[MIDIHomepageController alloc]init];
    homepage.title = @"迷笛音乐";
    homepage.tabBarItem.image = [[UIImage imageNamed:@"首页"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    homepage.tabBarItem.selectedImage = [[UIImage imageNamed:@"首页 拷贝 2"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UINavigationController * tabbar1 = [[UINavigationController alloc]initWithRootViewController:homepage];
    
    //    乐动圈
    MIDIMusicCircleController * musiccirle = [[MIDIMusicCircleController alloc]init];
    musiccirle.title = @"乐动圈";
    musiccirle.tabBarItem.image = [[UIImage imageNamed:@"音乐圈"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    musiccirle.tabBarItem.selectedImage = [[UIImage imageNamed:@"音乐圈 拷贝 2"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UINavigationController * tabbar2 = [[UINavigationController alloc]initWithRootViewController:musiccirle];
    
    //    我的
    MIDIMyController * my = [[MIDIMyController alloc]init];
    my.title = @"我的";
    my.tabBarItem.image = [[UIImage imageNamed:@"我的"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    my.tabBarItem.selectedImage = [[UIImage imageNamed:@"tabbar-icon-mine-selected"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UINavigationController * tabbar3 = [[UINavigationController alloc]initWithRootViewController:my];
    //    将界面添加到viewControllers中
    self.viewControllers =@[tabbar1,tabbar2,tabbar3];
    
    //设置tabbar颜色
    UIView *bgView = [[UIView alloc] initWithFrame:self.tabBar.bounds];
    // 给自定义 View 设置颜色
    bgView.backgroundColor = [UIColor colorWithHexString:@"#000000"];

    // 将自定义 View 添加到 tabBar 上
    [self.tabBar insertSubview:bgView atIndex:0];
    //    设置的tabbar颜色
    self.tabBar.tintColor = [UIColor colorWithHexString:@"#171717"];
}
#pragma mark - 弹出登录页面
- (void)modalPageLogin
{
    self.modalPresentationStyle = UIModalPresentationPageSheet;
    MIDIlandingController *landing = [[MIDIlandingController alloc] init];
    [self presentViewController:landing animated:YES completion:nil];
}


@end
